package com.wayhome.srpingbootmybatis.fileimportmanager.enums;


public enum BusinessTypeEnums {
    //信息核查-批量模式-结算信息导入
    SETL_INFO_VERIFY("setl_info_verify", "setlInfoVerifyImportHandler", "batch_setl_info_verify"),
    ;

    //业务类型
    private final String type;
    //该业务类型的处理器
    private final String handler;
    //对应生成异步任务时的task_type
    private final String taskType;

    public String getType() {
        return type;
    }

    public String getHandler() {
        return handler;
    }

    public String getTask(){
        return taskType;
    }

    BusinessTypeEnums(String type, String handler, String taskType) {
        this.type = type;
        this.handler = handler;
        this.taskType = taskType;
    }

    public static String getHandleByType(String type) {
        for (BusinessTypeEnums item : BusinessTypeEnums.values()) {
            if (item.type.equals(type)) {
                return item.handler;
            }
        }
        return null;
    }

    public static String getTaskTypeByType(String type) {
        for (BusinessTypeEnums item : BusinessTypeEnums.values()) {
            if (item.type.equals(type)) {
                return item.taskType;
            }
        }
        return null;
    }


}
